<template>
  <!-- //大div -->
  <div>
    <!-- 轮播图 -->
    <div class="block">
      <el-carousel height="50vh">
        <el-carousel-item v-for="(item, index) in slidelist" :key="index">
          <h3 class="small">
            <img width="100%" height="330vh" :src="item.picUrl" alt />
          </h3>
        </el-carousel-item>
      </el-carousel>
    </div>
    <!-- 列表 -->
    <div class="slideback" style="width:100%;height:14vh;background:white;">
      <div style="margin-top:6%">
        <van-grid>
          <van-grid-item icon="like-o" text="签到" />
          <van-grid-item icon="gift-o" text="礼券" />
          <van-grid-item icon="fire-o" text="砍价" />
          <van-grid-item icon="diamond-o" text="专栏" />
        </van-grid>
      </div>
    </div>
    <!-- //空div -->
    <div style="width:100%;height:10px;background:#f3f3f3"></div>
    <!-- //列表卡片 -->
    <br />
    <div style="text-align:center">全民砍价</div>
    <br />
    <div>
      <div v-for="(item , index) in  buttomlist.slice(9,12)" :key="index">
        <van-card
         
          :price="item.minPrice"
          :desc="item.recommendStatusStr"
          :title="item.name"
          :thumb="item.pic"
        />
      </div>
    </div>
    <!-- //空div -->
    <div style="width:100%;height:10px;background:#f3f3f3"></div>
    <br />
    <div style="text-align:center">精选专题</div>
    <br />
    <!-- //专题 -->
    <div>
      <div class="slidebig">
        <div class="slidelittle">
          <div
            style="float:left; width:19.5%;;margin-left:0.5%"
            v-for="(item, index) in slidelittle"
            :key="index"
          >
            <div style="float:left;width:100%; height: 32vh;">
              <img :src="item.pic" width="100%" height="75%" alt />
              <p style="font-size:13px">{{item.title}}</p>
              <p
                style="font-size:11px;color:gray;margin-left:1%; display: inline-block; white-space: nowrap;   width: 100%; overflow: hidden;text-overflow:ellipsis;"
              >{{item.descript}}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div style="width:100%;height:10px;background:#f3f3f3"></div>
    <br />
    <div style="text-align:center">人气推荐</div>
    <br />
    <div>
      <el-row>
        <el-col
          :span="8"
          v-for="(item , index) in  buttomlist.slice(9,13)"
          :key="index"
          :offset="index > 0 ? 2 : 0"
        >
          <div @click="cartlist(item.id)">
            <el-card :body-style="{ padding: '0px' }">
              <img :src="item.pic" width="100%" height="200vh" class="image" />
              <div style="padding: 14px;">
                <span
                  style="font-size:13px; display: inline-block; white-space: nowrap;   width: 100%; overflow: hidden;text-overflow:ellipsis;"
                >{{item.name}}</span>
                <div class="bottom clearfix">
                  <time class="time">{{ }}</time>
                  <span style="color:red;font-size:12px">￥:{{item.minPrice}}</span>
                </div>
              </div>
            </el-card>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>


<script>
export default {
  data() {
    return {
      slidelist: [], //轮播图数据
      buttomlist: [], //下列表数据
      slidelittle: [], //文章列表
    };
  },
  methods: {
    cartlist(id) {
      this.$router.push({
        path: "/cartlist",
        query: {
          id
        },
      });
    },
  },
  mounted() {
    this.$axios.slide({}).then((res) => {
      this.slidelist = res.data.data;
    });
    this.$axios.buttomlist({}).then((res) => {
      //  console.log(res.data.data);
      this.buttomlist = res.data.data;
    });
    this.$axios.slidelittle({}).then((res) => {
      this.slidelittle = res.data.data;
    });
  },
};
</script>
<style>
.el-col-8 {
  width: 40% !important;
  margin-left: 7% !important;
  margin-top: 7% !important;
}
.van-card {
  position: relative;
  box-sizing: border-box;
  padding: 8px 16px;
  color: #323233;
  font-size: 12px;
  background-color: white !important;
}
</style>
<style  scoped>
.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}
.slidelittle {
  width: 430vw;
  height: 30vh;
}
.slidebig {
  width: 100%;
  height: 32vh;
  overflow: scroll;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;

  margin: 0;
}

.slideback {
  border-radius: 20% 20% 0 0;
  margin-top: -16vh;
  position: absolute;
  z-index: 10000;
}
</style>
